﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Syllabus : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Calendar1.SelectedDate = DateTime.Today;

    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {

        Response.Redirect("~/Admin/Add_syllabus.aspx");
    }
    protected void btnEdit_Click(object sender, EventArgs e)
    {
        Label2.Visible = true;
        Label3.Visible = true;
        Label4.Visible = true;
        Label5.Visible = true;
        Label6.Visible = true;
        Label7.Visible = true;
        txtId.Visible = true;
        txtTitle.Visible = true;
        fulFilePath.Visible = true;
        Calendar1.Visible = true;
        ddlUserId.Visible = true;
        ddlProgramId.Visible = true;
        btnEdit1.Visible = true;
    }
    protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
    {
        txtId.Text = HttpUtility.HtmlDecode(GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text);
        txtTitle.Text = HttpUtility.HtmlDecode(GridView1.Rows[GridView1.SelectedIndex].Cells[2].Text);
        ddlUserId.SelectedValue = HttpUtility.HtmlDecode(GridView1.Rows[GridView1.SelectedIndex].Cells[5].Text);
        ddlProgramId.SelectedValue = HttpUtility.HtmlDecode(GridView1.Rows[GridView1.SelectedIndex].Cells[6].Text);
    }
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        SqlDataSource1.Delete();
    }
    protected void btnEdit1_Click(object sender, EventArgs e)
    {
        SqlDataSource1.Update();
    }
}
